.class public final Lcom/ninesky/a/d;
.super Ljava/lang/Object;


# static fields
.field private static a:I

.field private static b:I

.field private static c:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput v0, Lcom/ninesky/a/d;->a:I

    sput v0, Lcom/ninesky/a/d;->b:I

    sput v0, Lcom/ninesky/a/d;->c:I

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static a(Landroid/content/Context;)I
    .locals 3

    const/high16 v2, 0x430c

    const/high16 v0, 0x3f80

    if-eqz p0, :cond_0

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    iget v0, v0, Landroid/util/DisplayMetrics;->density:F

    :cond_0
    sget v1, Lcom/ninesky/a/d;->a:I

    if-nez v1, :cond_1

    mul-float v1, v2, v0

    float-to-int v1, v1

    sput v1, Lcom/ninesky/a/d;->a:I

    mul-float v1, v2, v0

    float-to-int v1, v1

    sput v1, Lcom/ninesky/a/d;->b:I

    const/high16 v1, 0x4370

    mul-float/2addr v0, v1

    float-to-int v0, v0

    sput v0, Lcom/ninesky/a/d;->c:I

    :cond_1
    sget v0, Lcom/ninesky/a/d;->a:I

    return v0
.end method

.method public static a(Landroid/graphics/Picture;Landroid/content/Context;)Landroid/graphics/Bitmap;
    .locals 5

    if-nez p0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    invoke-static {p1}, Lcom/ninesky/a/d;->a(Landroid/content/Context;)I

    move-result v0

    sget v1, Lcom/ninesky/a/d;->b:I

    if-nez v1, :cond_1

    invoke-static {p1}, Lcom/ninesky/a/d;->a(Landroid/content/Context;)I

    :cond_1
    sget v1, Lcom/ninesky/a/d;->b:I

    sget-object v2, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    invoke-static {v0, v1, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v1

    new-instance v2, Landroid/graphics/Canvas;

    invoke-direct {v2, v1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    invoke-virtual {p0}, Landroid/graphics/Picture;->getWidth()I

    move-result v3

    sget v4, Lcom/ninesky/a/d;->c:I

    if-nez v4, :cond_2

    invoke-static {p1}, Lcom/ninesky/a/d;->a(Landroid/content/Context;)I

    :cond_2
    sget v4, Lcom/ninesky/a/d;->c:I

    if-ge v3, v4, :cond_3

    :goto_1
    int-to-float v0, v0

    int-to-float v3, v3

    div-float/2addr v0, v3

    invoke-virtual {v2, v0, v0}, Landroid/graphics/Canvas;->scale(FF)V

    invoke-virtual {p0, v2}, Landroid/graphics/Picture;->draw(Landroid/graphics/Canvas;)V

    move-object v0, v1

    goto :goto_0

    :cond_3
    move v3, v4

    goto :goto_1
.end method

.method public static a(Landroid/graphics/Picture;Landroid/content/Context;II)Landroid/graphics/Bitmap;
    .locals 2

    const/4 v1, 0x0

    invoke-static {p0, p1}, Lcom/ninesky/a/d;->a(Landroid/graphics/Picture;Landroid/content/Context;)Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-static {v0, v1, v1, p2, p3}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIII)Landroid/graphics/Bitmap;

    move-result-object v0

    return-object v0
.end method
